package com.imooc.town.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * create by song on 2018/3/24
 * To change this template use File | Settings | File Templates.
 */
public class JsonUtil {


    public static String toJson(Object object){
        GsonBuilder gsonBuilder = new GsonBuilder ();
        gsonBuilder.setPrettyPrinting ();
        Gson gson = gsonBuilder.create ();
        return gson.toJson ( object );
    }
}
